<template>
    <div>
        <My-head title="选择电影院"></My-head>
    </div>
</template>

<script>
export default {
    data() {
        return {
            film: null
        }
    },
    methods: {
        async getFilm() {
            let res = await this.$ajax.getMaiData({
                filmId: this.$route.params.filmId
            },{
                'X-Host': 'mall.film-ticket.film.info'
            })
            this.film = res.data.film
        },
        async getTimelist(){
            let res = await this.$ajax.getMaiData({
                filmId: this.$route.params.filmId,
                cityId: this.city.cityId
            },{
                'X-Host': 'mall.film-ticket.cinema.film-show-cinema'
            })
            this.getCineams(res.data.showCinemas[0].cinemaList)
        },
        async getCineams(cinemaIds){
            let res = await this.$ajax.postMaiData({ // post
                cityId: this.city.cityId,
                cinemaIds: cinemaIds.join(",")
            },{
                'X-Host': 'mall.film-ticket.cinema.batch-cinema'
            })
        }
    },
    mounted() {
    this.getFilm()
    this.getTimelist()
  }
}
</script>